//
//  NetWorkConfig.m
//  lcf-newproject
//
//  Created by yangyang on 14-11-17.
//  Copyright (c) 2014年 yang. All rights reserved.
//

#import "NetWorkConfig.h"
#import "Reachability.h"
static NetWorkConfig * netWorkManager = nil;
@implementation NetWorkConfig
//网络监测类单例
+(NetWorkConfig *)shareNetWorkConfig{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
            netWorkManager = [[NetWorkConfig alloc]init];
    });
    return netWorkManager;
    
}

//检查是否有网络
-(BOOL)checkNetWork{
    return [netWorkManager isEnableWWAN]||[netWorkManager isEnableWifi];
}

//判断是否有wifi
-(BOOL)isEnableWifi{
    return ([[Reachability reachabilityForLocalWiFi]currentReachabilityStatus] != NotReachable);
}
//判断是否有2g、3g、4g信号
-(BOOL)isEnableWWAN{
    return ([[Reachability reachabilityForInternetConnection]currentReachabilityStatus] != NotReachable);
}

@end
